/*
 * @Description: 请描述此文件
 * @Author: LDM
 * @Date: 2021-09-03 17:01:28
 * @LastEditors: LDM
 * @LastEditTime: 2021-09-30 17:36:10
 */
// import type { RouteRecordRaw } from 'vue-router'
import type { IAppRouteRecordRaw } from '/@/router/types'
export const importRouterModules = (): IAppRouteRecordRaw[] => {
  const modules = import.meta.globEager('../modules/**/*.ts')
  const routeModuleList: IAppRouteRecordRaw[] = []
  Object.keys(modules).forEach((key) => {
    const mod = modules[key].default || {}
    const modList = Array.isArray(mod) ? [...mod] : [mod]
    routeModuleList.push(...modList)
  })
  return routeModuleList
}
